
package com.jing21.learn.intf.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

@ApiModel("用户信息")
@Table(name = "learn_user")
@Data
public class LearnUser implements Serializable {

    @Id
    @OrderBy("desc")
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Long id;

    @ApiModelProperty(value = "用户名", required = true)
    @NotNull(message = "用户名不能为空")
    @Column(name = "user_name")
    private String userName;

    @Column(name = "password")
    private String password;

    @ApiModelProperty(value = "手机号码")
    @Column(name = "phone")
    private String phone;

    @ApiModelProperty(value = "真实姓名")
    @Column(name = "real_name")
    private String realName;

    @ApiModelProperty(value = "电子邮件")
    @Column(name = "email")
    private String email;

    @ApiModelProperty(value = "状态 1-正常 2-舍弃 3-封印")
    @Column(name = "status")
    private Integer status;

    @ApiModelProperty(value = "创建者")
    @Column(name = "creator")
    private Integer creator;

    @ApiModelProperty(value = "创建时间", required = true)
    @Column(name = "create_time")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "修改者")
    @Column(name = "editor")
    private Integer editor;

    @ApiModelProperty(value = "修改时间")
    @DateTimeFormat(pattern = "")
    @Column(name = "edit_time")
    private LocalDateTime editTime;
}

